package org.newlucene.core.document;

import org.newlucene.core.analysis.Analyzer;


/**
  A field is a section of a Document.  Each field has two parts, a name and a
  value.  Values may be free text, provided as a String or as a Reader, or they
  may be atomic keywords, which are not further processed.  Such keywords may
  be used to represent dates, urls, etc.  Fields are optionally stored in the
  index, so that they may be returned with hits on the document.
  */

public final class Field
{
	// a bitset should be used to store the configuration
	// <store, posboost, pos, frq>, starting from the left, each bit stores one configuration
	public static final int FRQ = 1;
	public static final int POS = 2;
	public static final int POS_BOOST = 4;
	public static final int STORE = 8;

	private String name;
	private Analyzer analyzer;
	private int config;

	public Field(String name, Analyzer analyzer, int config)
	{
		this.name = name;
		this.analyzer = analyzer;
		this.config = config;
	}

	// the name of the field
	public String getName()
	{
		return name;
	}

	public Analyzer getAnalyzer()
	{
		return analyzer;
	}
	
	public int getConfig()
	{
		return config;
	}
}
